package Client;

import java.io.Serializable;
import java.util.ArrayList;

import Protocol.contact.Contact;
import Protocol.noticeMsgWord.NoticeMsgWord;
import Protocol.threadStatus.ThreadStatus;
import Protocol.user.BasePersonInfo;
import Protocol.user.DetailPersonInfo;

public class ClientData implements Serializable {
	private Client								client;
	
	private BasePersonInfo				server_basic;
	private BasePersonInfo        	   	self_basic;
	private DetailPersonInfo         	self_detail;
	private Contact                	  	self_contact;
	private ArrayList<BasePersonInfo>   bpiList;
	private ArrayList<ThreadStatus>		threadStatusList;
	private ArrayList<NoticeMsgWord> 	msgList;
	private ArrayList<String>			fileNameLoadedList;
	private int							fileUploadPort, fileDownloadPort;
	
	public ArrayList<ThreadStatus> getThreadStatusList() {
		return threadStatusList;
	}

	public void setThreadStatusList(ArrayList<ThreadStatus> threadStatusList) {
		this.threadStatusList = threadStatusList;
	}

	public ArrayList<BasePersonInfo> getBpiList() {
		return bpiList;
	}

	public void setBpiList(ArrayList<BasePersonInfo> bpiList) {
		this.bpiList = bpiList;
	}
	
	
	public ArrayList<String> getFileNameLoadedList() {
		return fileNameLoadedList;
	}

	public void setFileNameLoadedList(ArrayList<String> fileAbsPathLoadedList) {
		this.fileNameLoadedList = fileAbsPathLoadedList;
	}
	public ClientData(Client c) {
		client = c;
		this.fileNameLoadedList = new ArrayList<String>();
		this.fileUploadPort = 6868;
		this.fileDownloadPort = 6969;
	}
	
	public int getFileUploadPort() {
		return fileUploadPort;
	}

	public void setFileUploadPort(int fileUploadPort) {
		this.fileUploadPort = fileUploadPort;
	}

	public int getFileDownloadPort() {
		return fileDownloadPort;
	}

	public void setFileDownloadPort(int fileDownloadPort) {
		this.fileDownloadPort = fileDownloadPort;
	}

	public BasePersonInfo getServer_basic() {
		return server_basic;
	}

	public void setServer_basic(BasePersonInfo server_basic) {
		this.server_basic = server_basic;
	}

	public BasePersonInfo getSelf_basic() {
		return self_basic;
	}
	public void setSelf_basic(BasePersonInfo self_basic) {
		this.self_basic = self_basic;
	}
	public DetailPersonInfo getSelf_detail() {
		return self_detail;
	}
	public void setSelf_detail(DetailPersonInfo self_detail) {
		this.self_detail = self_detail;
	}
	public Contact getSelf_contact() {
		return self_contact;
	}
	public void setSelf_contact(Contact self_contact) {
		this.self_contact = self_contact;
	}
	public ArrayList<NoticeMsgWord> getMsgList() {
		return msgList;
	}
	public void setMsgList(ArrayList<NoticeMsgWord> msgList) {
		this.msgList = msgList;
	}
	public BasePersonInfo  getBpi(int    user_id){
		BasePersonInfo   ret= null;
		for(BasePersonInfo  bpi :  this.bpiList) {
			if(user_id ==  bpi.getUser_id()) {
				ret =    bpi;
				break;
			}
		}
		return ret;
	}
}
